package com.example.demo.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Collection;
import java.util.LinkedHashSet;

/**
 * Created by Administrator on 2018/06/13 0013.
 */
@Data
@Document
public class Person {
    @Id
    private String id;
    private String name;
    private Integer age;
    @Field("locs")
    private Collection<Location> locations = new LinkedHashSet<Location>();

    public Person() {}

    public Person(String name, Integer age) {
        super();
        this.name = name;
        this.age = age;
    }


}
